package com.example.controller;

import com.example.service.ScheduledExecutorServiceExampleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/scheduled/executor/service/example")
public class ScheduledExecutorServiceExampleController {

    private final ScheduledExecutorServiceExampleService service;

    public ScheduledExecutorServiceExampleController(ScheduledExecutorServiceExampleService service) {
        this.service = service;
    }

    @GetMapping("/schedule-tasks")
    public String scheduleTasks() {
        service.scheduleTasks();
        return "ScheduledExecutorService 示例任务已启动";
    }
}
